package org.darkforest.merchant.service;


import org.darkforest.model.*;
import org.darkforest.vo.GoodsImagesVo;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Libing on 2015/1/22.
 */
public interface IGoodsService {



    List<GoodsClass> publishGoods() throws Exception;

    Integer publishGoods_step2(GoodsCommonWithBLOBs goods, String tmpDir, String activeAreaType) throws Exception;

    void publishGoods_step3(MultipartFile[] goodsImages, String goodsCommonId) throws IOException;


    List<GoodsClass> getChildGoodsClass(String gcId, String deep);

    /**
     * 获取商品分类(父类)
     * @param category
     * @return
     */
    List<GoodsClass> publishGoods_step1(String category);

    /**
     * 修改商品
     * @param goodsCommonWithBLOBs
     * @param activeAreaType
     */
    void updateGoods(GoodsCommonWithBLOBs goodsCommonWithBLOBs, String activeAreaType);

    /**
     * 批量修改商品状态
     * @param goodsCommmonIds
     */
    void modifyGoodsStatusByBatch(String[] goodsCommmonIds, String goodsStatus,String goodsVerify);


    GoodsCommonWithBLOBs getGoodsCommonBLOBsById(Integer goodsCommonId);

    /**
     * 查询返回没有详情的商品信息
     * @param goods
     * @return
     */
    List<GoodsCommon> findSimpleGoodsCommonByCond(GoodsCommon goods);

    /**
     * 根据编号获取商品全部详情
     * @param goodsCommonId
     * @return
     */
    GoodsDetail getGoodsDetailById(Integer goodsCommonId);

    /**
     * 通过主键获取商品主要信息（不包含详情）
     * @param goodsCommonId
     * @return
     */
    GoodsCommon getGoodsCommonById(Integer goodsCommonId);


    /**
     * 批量添加商品图片
     * @param imagesVo
     */
    public int addGoodsImagesList(GoodsImagesVo imagesVo);

    /**
     * 根据商品编号获取商品图片列表
     * @param goodsCommonId
     * @return
     */
    public List<GoodsImages> getGoodsImageByCommonId(Integer goodsCommonId);

    /**
     * 根据条件搜索商品
     * @param keyword
     * @param searchType
     * @param type
     * @return
     */
    List<GoodsCommonWithBLOBs> searchGoods(String keyword, String searchType, String type);

    /**
     * 多商品状态查询
     * @param status
     * @return
     */
    GoodsCommonSearchBean findGoodsInState(GoodsCommonSearchBean status);

    /**
     * 根据商品名称搜索商品分页
     * @param goodsName
     * @return
     */
    GoodSearchBean searchGoodsByPage(GoodSearchBean goodsName);


    /**
     * 修改goodscommon
     * @param goodsCommon
     */
    void modifyGoodsCommonClass(GoodsCommon goodsCommon);
}
